package com.ml.admin.listener;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;
/**
 * 消费顺序消息
 * 配置RocketMQ监听
 *
 * 顺序消费
 * @author ml
 */
@Service
@RocketMQMessageListener(consumerGroup = "test",topic = "test-topic1",consumeMode = ConsumeMode.ORDERLY)
@Slf4j
public class ConsumerListener implements RocketMQListener<String> {
    @Override
    public void onMessage(String s) {
        System.out.println("consumer 收到消息:"+s);

    }
}